package com.xqboss.apps.dto.user;

import com.xqboss.apps.dto.PageDto;
import com.xqboss.apps.enums.user.UserWalletEnum;
import com.xqboss.apps.enums.user.WalletChangeDirectionEnum;
import com.xqboss.apps.enums.user.WalletChangeTypeEnum;
import com.xqboss.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Objects;

/**
 * <p>
 * 用户提现记录请求
 * </p>
 *
 * @author Trent
 * @date 2023/8/22
 */
@Data
@ApiModel
public class WithdrawRecordListDto extends PageDto {

    @ApiModelProperty("用户ID, APP不用传")
    private Long userId;

    @ApiModelProperty("钱包类型")
    private UserWalletEnum walletType;

    @ApiModelProperty("钱包变动记录方向")
    private WalletChangeDirectionEnum direction;

    @ApiModelProperty("钱包变动类型")
    private WalletChangeTypeEnum changeType;

    @ApiModelProperty("时间筛选 - 开始时间")
    private LocalDateTime createTimeStart;

    @ApiModelProperty("时间筛选 - 结束时间")
    private LocalDateTime createTimeEnd;

    @ApiModelProperty("不传")
    private String formattedDateTimeStart;

    @ApiModelProperty("不传")
    private String formattedDateTimeEnd;


    public LocalDateTime getCreateTimeEnd() {
        if (Objects.nonNull(createTimeEnd)) {
            return createTimeEnd.with(LocalTime.MAX);
        }
        return createTimeEnd;
    }
}
